home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------
- //Borland C++Builder
- //Copyright (c) 1987, 1998 Borland International Inc. All Rights Reserved.
- //----------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
-
- #include "maintest.h"
- #include <stdio.h>
- #include <comobj.hpp>
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm2 *Form2;
- //---------------------------------------------------------------------------
- __fastcall TForm2::TForm2(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
-
- void __fastcall TForm2::Button1Click(TObject *Sender)
- {
- try{
- // Start the Server Object
- MyAutoServer = CoMyAuto::Create();
- MyAutoServer->ShowDialog();
- //Pass strings as BSTRs
- MyAutoServer->set_MyProp(WideString("This string was passed to the MyProp property of AutoProj by TestApp").c_bstr());
- MyAutoServer->ShowDialog();
- }
- catch(EOleSysError& e){
- char buf[256];
- sprintf(buf, "%s.\n\n%s", e.Message.c_str(),
- "Make sure you compile Srvr first and run it either from\n"
- "the commmand line or from C++Builder.\n");
- ShowMessage(buf);
- }
- }
- //---------------------------------------------------------------------------
-